<template>
  <div class="dashboard-container">
    <div class="dashboard-text">
      <ImageUpload :limit-count="2" />
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'Dashboard',
  computed: {
    ...mapGetters([
      'name'
    ])
  },
  methods: {
    handleSuccess(header, results) {
      console.log('我成功了', header, results)
    },
    beforeUpload(file) {
      console.log('上传前校验', file)
      const isLt1M = file.size / 1024 / 1024 < 1

      if (isLt1M) {
        return true
      }

      this.$message({
        message: '文件体积超过1M了',
        type: 'warning'
      })
      return false
    }
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 30px;
    line-height: 46px;
  }
}
</style>
